package com.wh.connection_pool;

import java.io.Serializable;

/**
 * 
 * @author Administrator
 * @document 这是外部可以配置的连接池属性，拥有默认值
 */
public class DBbean implements Serializable{

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	//连接池属性
	private String driverName;
	private String url;
	private String username;
	private String password;
	//连接池名字
	private String poolName;
	private int minConnections = 1;	//空闲值，最小连接数
	private int maxConnections = 10; //空闲值，最大连接数
	private int initConnnections = 5;	//初始化连接数
	private long connTimeout = 1000; //重复获得连接的频率
	private int maxActiveConnections = 100; //最大允许的连接数，和数据库对应
	private long connectionTimeOut = 1000 * 60 * 20; //连接超时时间 默认20分钟
	private boolean isCurrentConnection = true;	//是否获得当前连接，默认true
	private boolean isCheckPool = true;	//是否定时检查连接池
	private long lazyCheckTime = 1000 * 60 * 60;	//检查连接池的延迟时间
	private long periodCheck = 1000 * 60 * 60; //检查频率
	
	
	
	public String getDriverName() {
		return driverName;
	}
	public void setDriverName(String driverName) {
		this.driverName = driverName;
	}
	public String getUrl() {
		return url;
	}
	public void setUrl(String url) {
		this.url = url;
	}
	public String getUsername() {
		return username;
	}
	public void setUsername(String username) {
		this.username = username;
	}
	public String getPassword() {
		return password;
	}
	public void setPassword(String password) {
		this.password = password;
	}
	public String getPoolName() {
		return poolName;
	}
	public void setPoolName(String poolName) {
		this.poolName = poolName;
	}
	public int getMinConnections() {
		return minConnections;
	}
	public void setMinConnections(int minConnections) {
		this.minConnections = minConnections;
	}
	public int getMaxConnections() {
		return maxConnections;
	}
	public void setMaxConnections(int maxConnections) {
		this.maxConnections = maxConnections;
	}
	public int getInitConnnections() {
		return initConnnections;
	}
	public void setInitConnnections(int initConnnections) {
		this.initConnnections = initConnnections;
	}
	public long getConnTimeout() {
		return connTimeout;
	}
	public void setConnTimeout(long connTimeout) {
		this.connTimeout = connTimeout;
	}
	public int getMaxActiveConnections() {
		return maxActiveConnections;
	}
	public void setMaxActiveConnections(int maxActiveConnections) {
		this.maxActiveConnections = maxActiveConnections;
	}
	public long getConnectionTimeOut() {
		return connectionTimeOut;
	}
	public void setConnectionTimeOut(long connectionTimeOut) {
		this.connectionTimeOut = connectionTimeOut;
	}
	public boolean isCurrentConnection() {
		return isCurrentConnection;
	}
	public void setCurrentConnection(boolean isCurrentConnection) {
		this.isCurrentConnection = isCurrentConnection;
	}
	public boolean isCheckPool() {
		return isCheckPool;
	}
	public void setCheckPool(boolean isCheckPool) {
		this.isCheckPool = isCheckPool;
	}
	public long getLazyCheckTime() {
		return lazyCheckTime;
	}
	public void setLazyCheckTime(long lazyCheckTime) {
		this.lazyCheckTime = lazyCheckTime;
	}
	public long getPeriodCheck() {
		return periodCheck;
	}
	public void setPeriodCheck(long periodCheck) {
		this.periodCheck = periodCheck;
	}
	
		
}
